<?php
class AdminGroupDao {
	public function get($id){
		return ClassManager::getSql()->oneDataCache('admin_group','id' , $id);
	}
	public function add($data){
		ClassManager::getSql()->insert('admin_group', $data);
	}
	public function update($data,$id){
		ClassManager::getSql()->updates('admin_group', $data,"where id='".intval($id)."'");
	}
	public function deleteBatchByid($id){
		ClassManager::getSql()->delete('admin_group',"where id in(".$id.")");
	}
	public function count(){
		$count = ClassManager::getSql()->onedata('admin_group',"count(*)  ");
		return  $count[0];
	}
	/**
	 * 根据据 limit 获得条    $limit[0]起始调 $limit[1]几条
	 */
	public function getList($limit){
		return  ClassManager::getSql()->datalist('admin_group','*'," order by id desc ",$limit);
	}
	/**
	 * 所有记录列表
	 */
	public function getList1(){
		return ClassManager::getSql()->datalist('admin_group');
	}
}
?>